<!--
 * @Author: hrg
 * @Date: 2023-04-10 20:43:49
 * @LastEditTime: 2023-06-30 11:49:23
 * @FilePath: \study_-vuejs\dome\study_vue_demo\index.html
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>learn vue</title>
  <script src="./vue.js"></script>
  <script src="../../dayjs.min.js"></script>
</head>

<body>


  <div id="root">
    <h1>展示当前时间：{{Date.now()}}</h1>
    <h1>展示当前时间：{{format_time}}</h1>

  </div>
  <script>
    Vue.config.productionTip = false
    // 通过计算属性进行的过滤
    const vm = new Vue({
      el: '#root',
      data: {
        time:Date.now()
      },
      computed:{
        format_time(){
          return dayjs(this.time).format("YYYY年MM月DD日 HH:mm:ss")
        }
      }
      
    });

  </script>

</body>

</html>